package com.jctrip.hotel.management.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.jctrip.hotel.management.model.param.CloseStoreParam;
import com.jctrip.hotel.management.model.result.GetCloseLogsResult;
import com.jctrip.hotel.management.model.result.GetRouteCodeResult;
import com.jctrip.hotel.management.model.result.Result;
import com.jctrip.hotel.management.service.QunarinSystemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author: ch
 * @CreateTime: 2023/12/25 2:39 PM
 * @Description:
 */
@Slf4j
@Api(tags = "management-qunarin")
@RestController
@RequestMapping("/management/qunarin")
public class QunarinController {
    @Autowired
    private QunarinSystemService qunarinSystemService;

    @PostMapping("/closeStore")
    @ApiOperation(value = "closeStore",notes = "去哪儿(国内)马甲下线")
    public Result<String> closeStore(@RequestBody CloseStoreParam param, HttpServletRequest request){
        return Result.ok(qunarinSystemService.closeStore(param,request));
    }
    @GetMapping("/listRouteCode")
    @ApiOperation(value = "listRouteCode",notes = "去哪儿国内渠道id")
    public Result<GetRouteCodeResult> listRouteCode(){
        return Result.ok(qunarinSystemService.listRouteCode());
    }
    @GetMapping("/listCloseLogs")
    @ApiOperation(value = "listCloseLogs",notes = "获取马甲下线操作日志")
    public Result<GetCloseLogsResult> listCloseLogs(@RequestParam Integer pageNum,
                                                    @RequestParam Integer pageSize,
                                                    @RequestParam String routeId){
        return Result.ok(qunarinSystemService.listCloseLogs(pageNum, pageSize, routeId));
    }

}
